<template>
    <div class="base-b">
        <div>我是B组件（发布方）</div>
        <button @click="sendMsgFn">发送消息</button>
        <button @click="delMsgFn">删除消息(发送空消息)</button>
    </div>
</template>

<script>
import Bus from '../utils/EventBus'

export default {
    methods: {
        sendMsgFn() {
            Bus.$emit('sendMsg', '今天天气不错，适合旅游')
        },
        delMsgFn() {
            Bus.$emit("delMsg", "")
        }
    },
}
</script>

<style scoped>
.base-b {
    width: 200px;
    height: 200px;
    border: 3px solid #000;
    border-radius: 3px;
    margin: 10px;
}
</style>